<?php
/*
*微博内容
*reply.php
*/
require_once('init.php');

$logid = isset($_GET['id']) ? intval($_GET['id']) : '';

require_once('model/class.mlog.php');
require_once('model/class.cates.php');
require_once('model/class.user.php');
require_once('model/class.comment.php');
require_once('model/class.attachment.php');

$qiMlog = new qiMlog($DB);
$qiCate = new qiCate($DB);
$qiUser = new qiUser($DB);
$qiComment = new qiComment($DB);
$qiAttachment = new qiAttachment($DB);

$logDate = $qiMlog->getOneMlog($logid);

$logDate['photo'] = $qiAttachment->getMlogPic($logDate['aid']);


$logComm = $qiComment->getComments($logid);

//添加评论
if($action == 'addcomm')
	{
	$commContent = t(isset($_POST['commcontent']) ? $_POST['commcontent'] : '');
	$ctime = time();
	if($commContent == '')
	{
	redirect('reply.php?id='.$logid.'', 3, '回复内容不能为空！');
	}
	else
	{
	$qiComment->addComment($logid, $uid, $commContent, $ctime);
	redirect('reply.php?id='.$logid.'', 3, '回复成功，3秒钟跳转到微博页！');
	}
	}

// 输出模板
$xingTemplate->display('reply');
?>